<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
	<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/styles.css" />
	<title>Crea Nuovo Hotel</title>
</h:head>

<h:body>
<div id="header">
	<ui:include src="/resources/snippets/headerDipendente.xhtml"></ui:include>
</div>
	<h1>Crea Nuovo Hotel</h1>
	<br/>
	<h:form>
	<h:outputLabel for="nome">Nome Hotel:</h:outputLabel>
	<h:inputText id="nome" value="#{hotel.current.nome}" />
	<h:message for="nome"></h:message> <br/>
	<br/>
	<h:outputLabel for="citta">Città Hotel:</h:outputLabel>
	<h:inputText id="citta" value="#{hotel.current.citta}" />
	<h:message for="citta"></h:message> <br/>
	<br/>
	<h:outputLabel for="numStelle">Numero di Stelle:</h:outputLabel>
	<h:inputText id="numStelle" value="#{hotel.current.numStelle}" />
	<h:message for="numStelle"></h:message> <br/>
	<br/>
	<p:commandButton value="Crea Nuovo" action="#{hotel.create()}" />
	</h:form>
	<br/>
	<br/>
	<br/>
	<h:link outcome="creaProdottoBase" value="Torna Indietro" /> <br/>
	<p:dialog id="errHotelDup" header="Hotel duplicato" widgetVar="errHotelDup" modal="true">  
    	<h:outputText value="Attenzione: esiste già un hotel con questo nome nella stessa città!" /> <br/>
    	<p:commandButton id="errHotelButton" value="Ok" onclick="PF('errHotelDup').hide();" type="button"/>  
	</p:dialog>
	<br/>
	<br/>
	<br/>
<div id="footer">
	<ui:include src="/resources/snippets/footer.xhtml"></ui:include>
</div>
</h:body>
</html>